/**
 * 功能描述 导航
 */

define(function (require, exports, module) {
	var Component = require("subnav");
	var user = require("store").get("user");

//	var subnavEvents = require("../handler/subnavEvents");
//	var queryChargeDataSvc = require("../store/queryChargeDataSvc");//加
    var instance = {
        initComponent: function (params, widget) {
            var component = new Component({
            	parentNode:".J-subnav",
				model : {
					title:"散客订金确认",
					items : [{
					      id :"servicePoint",
					      type : "buttongroup",
					      all : {
					    	  show:false,
					    	  first:true
					      },
					      tip : "服务点",
					      keyField :"pkServicePoint",
					      valueField : "name",
					      items:user.privateServicePoints,
//					      url : "api/servicepoint/operableservicepoints",
					      params : function(){
					    	  return{
					    		  fetchProperties:"pkServicePoint,name"
					    	  }
					      },
					      handler : function(key,element){
					    	  widget.get("grid").refresh();
					      }
				    },{
						id : "status",
						tip:"状态",
						type:"buttongroup",
						items:[{
							key:"Reserve",
							value:"待收费",
						},{
							key:"Effective",
							value:"已收费"
						}],
						handler:function(key,element){
							widget.get("grid").refresh();
						}
					},{
						id : "startDate",
						type : "daterange",
						tip:"入住时间",
						ranges : {
					        "本年": [moment().startOf("year"), moment().endOf("days")]
//			                "今天": [moment().startOf("days"), moment().endOf("days")],
//			                "本月": [moment().startOf("month"), moment().endOf("month")]
						},
						defaultRange: "本月",
						handler : function(time){
							 widget.get("grid").refresh();
						}
					}]
				}
            });
            widget.set("subnav", component);
        }
    };
    module.exports = instance;
});
